#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

#define MAXN 10010

int val[MAXN];      int dp[MAXN];

int main(){
    dp[0] = 1;
    int n;      int m;
    cin >> n >> m;
    for(int i = 1; i <= n; i++){
        scanf("%d",&val[i]);
    }
    for(int i = 1; i <= n; i++){
        for(int j = m; j >= val[i]; j--){
            dp[j] += dp[j - val[i]];
        }
    }
    cout << dp[m] << endl;
    return 0;
}